'use strict';
import React, { Component } from 'react';
import  {
    AppRegistry,
    Navigator,
    StyleSheet,
    TouchableOpacity,
    Text
} from 'react-native';

import footer from './xcmapp/html/footer';
class Test2 extends Component{

    render() {
        return (
            <Navigator initialRoute={{component: footer}} configureScene={this.configureScene} renderScene={this.renderScene}/>
        );
    }

    /**
     * 配置场景动画
     * @param route 路由
     * @param routeStack 路由栈
     * @returns {*} 动画
     */
    configureScene = (route, routeStack) => {
        if (route.type == 'Bottom') {
            return Navigator.SceneConfigs.FloatFromBottom; // 底部弹出
        } else if(route.type == 'Left'){
            return Navigator.SceneConfigs.FloatFromLeft; // 左侧弹出
        }
        return Navigator.SceneConfigs.PushFromRight; // 右侧弹出
    };

    /**
     * 使用动态页面加载
     * @param route 路由
     * @param navigator 导航器
     * @returns {XML} 页面
     */
    renderScene = (route, navigator) => {
        return (<route.component navigator={navigator}  {...route.passProps}/>)
    }

}
AppRegistry.registerComponent('Test2', () => Test2);
